const express = require('express');
const router = express.Router();
const activityController = require('../controllers/activityController');
const { authenticate, adminOnly } = require('../middleware/auth');

// 获取活动列表
router.get('/', authenticate, activityController.getActivities);

// 获取活动详情
router.get('/:id', authenticate, activityController.getActivityById);

// 创建活动（仅管理员）
router.post('/', authenticate, adminOnly, activityController.createActivity);

// 更新活动（仅管理员）
router.put('/:id', authenticate, adminOnly, activityController.updateActivity);

// 删除活动（仅管理员）
router.delete('/:id', authenticate, adminOnly, activityController.deleteActivity);

module.exports = router;